﻿using System;
using System.Windows.Forms;
using RemoteTestRunner.BusinessLogic.Models;
using RemoteTestRunner.BusinessLogic.Views;

namespace RemoteTestRunner.BusinessLogic.Presenters
{
    public class EditTestsPresenter : DialogPresenterBase
    {
        private readonly IEditTestsView _view;

        public EditTestsPresenter(IEditTestsView view)
        {
            _view = view;
        }

        public override void Start()
        {
            _view.Model = RtrServiceResolver.Service;
            if (_view.ShowDialog(Parent) == DialogResult.OK)
            {
                RtrServiceResolver.OnDataChanged(this, EventArgs.Empty);
            }
        }

        public override void Stop()
        {
            _view.Close();
        }
    }
}